home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #2 / Monster Media No. 2 (Monster Media)(1994).ISO / utils1 / flpkit10.zip / FLOPTOOL.DOC < prev   
Text File  |  1994-07-19  |  19KB  |  346 lines

  1.  
  2.                        Floppy Tool Kit, Version 1.0
  3.                               William Luitje
  4.                               20 January 1994
  5.  
  6.          This  is  a collection of 5 small utilities  which  will 
  7.          help  you  use  your floppy disks  better.    Since  you 
  8.          probably  worry more about how to get better  speed  and 
  9.          storage  out  of your hard disk,  this is not  likely  a 
  10.          matter of pressing concern to you.   However,   floppies 
  11.          are going to be used for quite a while and by spending a 
  12.          few minutes with these utilities you can make things  go 
  13.          a little bit faster each time you use a floppy. 
  14.  
  15.          FLOPPARM
  16.          ~~~~~~~~
  17.          Floppies  have  been  around a long time and  have  been 
  18.          improved since they first came out, not only in capacity 
  19.          but  also  in their mechanical  speed.    Unfortunately, 
  20.          system software can't tell what the best speed to  drive 
  21.          a  floppy is and must be compatible with old drives  and 
  22.          so uses conservatively slow parameters.   When accessing 
  23.          a  floppy,   the BIOS uses a table called the Disk  Base 
  24.          Table for these parameters.   This table can be found by 
  25.          looking  at interrupt vector 0X1E.  Since this table  is 
  26.          usually  set  up in RAM by DOS,  it is an easy thing  to 
  27.          modify  it for modern,  fast drives.   FLOPPARM will  do 
  28.          this for you conveniently; simply run it with one of the 
  29.          three arguments SLOW,  MEDIUM, or FAST.   The parameters 
  30.          which are affected are: 
  31.  
  32.            ■ step rate and head unload time, which are parameters 
  33.              of the disk controller chip. 
  34.  
  35.            ■ head settle time,  which is the amount of time taken 
  36.              after stepping from one track to another to wait for 
  37.              the head mechanism to stop vibrating. 
  38.  
  39.            ■ motor  startup time,  which  is the amount  of  time 
  40.              taken to allow the spindle motor speed to  stabilize 
  41.              after it first starts up. 
  42.  
  43.          SLOW  is  provided  for compatibility  with  really  old 
  44.          drives;  MEDIUM is somewhat faster than DOS 5;  and FAST 
  45.          is  pedal  to  metal!  When run,  FLOPPARM  displays the 
  46.          parameters used.  If run with no or an illegal argument, 
  47.          FLOPPARM  will  display  a usage hint  and  the  current 
  48.          values of the parameters. 
  49.  
  50.          FLOPPARM also allows you to specify your own  parameters 
  51.          by using the CUSTOM argument followed by an equals  sign 
  52.          and  the four parameters (step rate,  head unload  time, 
  53.          head  settle time and motor startup time)  separated  by 
  54.          commas  (no  spaces allowed).   For  example  a  command 
  55.          equivalent to FLOPPARM MEDIUM would be 
  56.  
  57.          flopparm custom=13,15,1,2
  58.  
  59.          Legal values for step rate and head unload time are from 
  60.          0   to  15.    Legal values for  head  settle  time  (in 
  61.          milliseconds)   and  motor startup time (in  1/8s  of  a 
  62.          second) are from 0 to 255 
  63.          
  64.          Note that FLOPPARM is not a TSR and does not take up any 
  65.          DOS memory;  it simply modifies a table which is already 
  66.          created by DOS. Once you decide which parameters to use, 
  67.          just  put  a line invoking FLOPPARM in your AUTOEXEC.BAT 
  68.          file and enjoy a modest increase in floppy speed. 
  69.  
  70.          FLOPTEST
  71.          ~~~~~~~~
  72.          How  can  you  tell if you have set  your  floppy  drive 
  73.          parameters too fast?  I've included a utility which will 
  74.          seek  to  every  track of the disk,  read a  sector  and 
  75.          report any errors it finds.   The seek pattern is called 
  76.          a "butterfly test"  since it reads the first track, then 
  77.          the last track, then the second track,  then the next to 
  78.          last  track,  etc.   This will really give the  drive  a 
  79.          workout! 
  80.  
  81.          This  test requires a formatted floppy which has no  bad 
  82.          sectors  (FLOPTEST can't tell if an error is due to  the 
  83.          drive not working properly or due to a bad disk).  It is 
  84.          a read only test so it shouldn't change any data  on the 
  85.          disk.    There  are two parameters:   one is  the  drive 
  86.          letter  and the second is the number of passes  to  run.  
  87.          If  you  get any errors and your floppy is ok  then  you 
  88.          should  back  off  one  or  more  of  the  floppy  drive 
  89.          parameters and test again. Here is an example
  90.  
  91.             floptest a 20
  92.  
  93.          If  you  are fortunate enough to have more than  2  disk 
  94.          drives  (this applies both to FLOPTEST and to the  other 
  95.          utilities in this package),  you can refer to the  third 
  96.          drive as c and the fourth drive as d, even if you have a 
  97.          hard drive that goes by either of those names.   I  know 
  98.          this  is  confusing  but this test operates at the  BIOS 
  99.          level  and has no idea what  letter DOS has assigned  to 
  100.          your  third  and  fourth floppies.   I  had a choice  of 
  101.          confusing  people who had more than 2 floppy  drives  or 
  102.          confusing everybody by making you specify the drive with 
  103.          a number rather than a letter.  That's life. 
  104.  
  105.          You  can  also use FLOPTEST to see if a floppy disk  has 
  106.          any  bad  sectors.   If you run it with only  the  drive 
  107.          letter  specified,  then it will attempt to  read  every 
  108.          sector  and  report any failures.  Since FLOPTEST  makes 
  109.          only  one attempt to read each sector,  it will warn you 
  110.          if a sector is getting weak. 
  111.  
  112.          FLOPSKEW
  113.          ~~~~~~~~
  114.          The  most  important improvement you can make  in  using 
  115.          your  floppy  drives  is  to  format  your  disks  using 
  116.          FDFORMAT  by  Christoph  Hochstätter  or ATFMT  by  Oleg 
  117.          Kibirev.    These programs allow almost complete control 
  118.          over  how your disks are formatted.  Among other things, 
  119.          you can put up to 820K on 5¼"  DSDD disks,  1.48  meg on 
  120.          5¼"  HD disks and 1.7 meg on 3½" HD disks.   In terms of 
  121.          speeding up floppy disk transfers,  these programs allow 
  122.          you to control the way sectors are arranged on  a track.  
  123.          This concept is  called  sector  sliding by FDFORMAT and 
  124.          sector spinning by ATFMT; in the US it's known as sector 
  125.          skewing.   Basically,  the idea is  that since  there is 
  126.          some mechanical delay in changing heads or tracks it may 
  127.          be  desirable to put the first sector of a new  head  or 
  128.          track "later" in the track so the computer doesn't  have 
  129.          to  wait for the floppy to make  a  complete  revolution 
  130.          before  that sector can be read.   See  these  programs' 
  131.          documentation for more details on how  this works.   The 
  132.          time  savings  when reading or  writing  a floppy can be 
  133.          substantial  when you format it using the  optimal  skew 
  134.          parameters  and,   as an added benefit,   formatting  is 
  135.          faster, too. 
  136.  
  137.          You  can  specify  head  skew and  track  skew  in  both 
  138.          FDFORMAT   and   ATFMT  by  the  X  and  Y   parameters, 
  139.          respectively.    The DOS FORMAT program does not support 
  140.          sector  skewing  at  all;  this is equivalent  to  using 
  141.          FDFORMAT  or ATFMT with X and Y both set to zero.    But 
  142.          what values should you use for these parameters?   Well, 
  143.          when FDFORMAT first introduced this feature,  I  wrote a 
  144.          batch  file  which  formatted a test disk  with  various 
  145.          combinations of the head and sector skew parameters  and 
  146.          then  measured how long it took to copy a large file  to 
  147.          the floppy.   It took about an hour to run and tested 16 
  148.          combinations of X and Y values for just one disk format.  
  149.          FLOPSKEW  does  the same job in just a few  seconds  but 
  150.          tests even more combinations of parameter values. 
  151.          
  152.          To use FLOPSKEW,  first decide which setting of FLOPPARM 
  153.          to  use and then run FLOPPARM with that  parameter since 
  154.          the  step  rate  and head settle time will  both  affect 
  155.          skewing.   Then, format  a disk of the type and capacity 
  156.          for   which  you  want  to  find  the  optimal   skewing 
  157.          parameters  with  the  X and  Y  parameters both  0  and 
  158.          interleave  1.    Although FLOPSKEW is a non-destructive 
  159.          test,  you should use a freshly formatted disk to ensure 
  160.          that these  parameters are set correctly,  otherwise the 
  161.          test will give strange results.   If you don't specify X 
  162.          and Y,  FDFORMAT and ATFMT default to the correct values 
  163.          except  that they both must use an interleave of  2  for 
  164.          the 5¼" 1.44  meg and 3½" 1.7  meg formats (and for this 
  165.          reason  it doesn't make sense to use sector skewing with 
  166.          these formats). DOS FORMAT always formats with no sector 
  167.          skewing and interleave 1. 
  168.  
  169.          Then,  simply run FLOPSKEW with the drive letter of  the 
  170.          floppy you want to test as the only parameter.   Here is 
  171.          an example  command and its results for a double density 
  172.          (720K) 3½" disk on my system: 
  173.  
  174.             flopskew b
  175.  
  176.             Find Optimal Head & Track Skew, Ver 1.0
  177.             9 Sectors/Track, 80 Tracks, 2 Sides
  178.  
  179.             Head Skew Times (milliseconds):
  180.             X:       0   1   2   3   4   5   6   7   8
  181.             Time:   32  54  74  95 116 137 158 178 199
  182.  
  183.             Track Skew Times (milliseconds):
  184.             Y:       0   1   2   3   4   5   6   7   8
  185.             Time:  232  53  74  95 116 137 158 178 199
  186.  
  187.             Interleave:  1
  188.             Minimum skewing parameters:  X=0, Y=1
  189.             Recommended skewing parameters:  X=1, Y=2
  190.  
  191.          First  you  are shown the format of the  test  diskette, 
  192.          then  some  test  results and  finally  the  recommended 
  193.          skewing  parameters.    If  you are interested  in  some 
  194.          technical  details about the test you  should  read  the 
  195.          next few paragraphs; otherwise you can skip ahead to the 
  196.          next  section.   Just use the recommended parameters  to 
  197.          format your disks and expect your diskette throughput to 
  198.          become about 30% faster. 
  199.  
  200.          Two  tests are run to find the best values for the  Head 
  201.          Skew  parameter (X)  and the Track Skew  parameter  (Y). 
  202.          The  head skew test is run by reading the last sector of 
  203.          the  first  track using head 0 and  then  measuring  how 
  204.          long, in milliseconds, it takes to read the first sector 
  205.          of  that  same  track  with  head 1.   (If the  disk  is 
  206.          formatted with only one side this test is not run.)  The 
  207.          track skew test is run by reading the last sector of the 
  208.          first  track  using head 1  (if testing a  double  sided 
  209.          disk)  and then  measuring how long it takes to read the 
  210.          first  sector of the second track using head 0.   In the 
  211.          results above, the second line tells how long this took, 
  212.          in milliseconds,  for each of  the sectors on the second 
  213.          track read. 
  214.          
  215.          Let's look at the example data to see what we can learn. 
  216.          First,  notice that the times to read different  sectors 
  217.          in the head skew test increase by about 22 milliseconds. 
  218.          This  is just the time it takes to read one  sector  for 
  219.          this format.  The formula is 
  220.  
  221.          sector read time(ms) = 1000 * 60sec/min * rpm / sectors
  222.  
  223.          For  this format the drive rotates at 300  rpm and there 
  224.          are 9 sectors so the time to read a sector works out  to 
  225.          22.2   milliseconds.    This formula can be modified  to 
  226.          figure the time to read an entire track by dropping  the 
  227.          final division by sectors.  In this case, it is 200 ms.  
  228.          
  229.          To  determine the  best values for X and Y,  the program 
  230.          finds  the smallest time and the corresponding number of 
  231.          sectors skipped from the line above.  The data show that 
  232.          for my system no sectors should be skipped when changing 
  233.          heads  so  the optimal head skew parameter,  X,   is  0. 
  234.          Typical values are 0 or 1 for most systems.  Now look at 
  235.          the  results  for the track skewing test;  the  time  to 
  236.          change tracks without skipping any sectors is 232!  This 
  237.          is  the  time  it takes to read a whole track  plus  the 
  238.          sector  plus some overhead.   In this case the 0  sector 
  239.          skew  provided by DOS format and the default values used 
  240.          by  FDFORMAT  and ATFMT yield a big waste of  time  when 
  241.          reading  or writing multiple tracks.   On my system  the 
  242.          optimal track skew parameter,  Y, is 1.   Typically,  it 
  243.          ranges from 1 to 3 on the systems I have looked at. 
  244.  
  245.          Now  notice  that the program recommends values for  the 
  246.          skew  parameters  which are 1 greater than  the  optimal 
  247.          values.  This is because the penalty for choosing a skew 
  248.          value which is too small is severe:   you have to wait a 
  249.          whole revolution,   in this case 200  ms, when  changing 
  250.          tracks.     On  the other hand, the penalty for having a 
  251.          skew value which is one too big is only 22  ms.    Since 
  252.          some  software may introduce  an additional  delay  when 
  253.          changing  tracks,   it is a safe bet to be  conservative 
  254.          when  choosing the  skew values.  If you  regularly  use 
  255.          floppies  on two computers you should  run  FLOPSKEW  on 
  256.          both  of them and choose the higher of  the  recommended 
  257.          skew parameters. 
  258.  
  259.          Take the values of X and Y found by the above  procedure 
  260.          and use them to format your floppies in the future.   To 
  261.          make this easy, you can create a batch file, 4DOS or CED 
  262.          alias,   or  FDFORMAT or ATFMT configuration  file  with 
  263.          those parameters in it.  Any time you format a floppy or 
  264.          read  or  write  a floppy formatted this way it will  go 
  265.          faster.  
  266.  
  267.          How much faster?   Well,  assuming the most likely  case 
  268.          that  only  track seek is a problem and that the  sector 
  269.          skewing  is  only  off by 1 or 2,   then  on average the 
  270.          computer  has  to wait for a full disk revolution  every 
  271.          second  track it reads.   Eliminate the wait and you can 
  272.          reduce  the time spent reading and writing by 1/3.  When 
  273.          formatting  a diskette, skewing only affects  the verify 
  274.          operation so the time reduction is somewhat less,  about 
  275.          20%. 
  276.  
  277.          FLOPRPM
  278.          ~~~~~~~
  279.          If you are having trouble reading or writing  diskettes, 
  280.          especially with a large number of sectors per track, the 
  281.          problem may lie with the speed at which the drive spins.  
  282.          FLOPRPM will test this condition for you.   Simply place 
  283.          a  formatted disk in the drive you want to test and  run 
  284.          FLOPRPM with the drive letter as the only argument.  The 
  285.          program  will  then test and display the  rotation  rate 
  286.          continuously  until you press a key.   Normally,  all PC 
  287.          floppy  drives  will  run within an RPM or  two  of  300 
  288.          except for 5¼"  HD drives which run at 360.   If you are 
  289.          having  problems  and the speed of your drive is off  by 
  290.          more than that,  you may be able to get better operation 
  291.          by adjusting the speed of your drive.  Unfortunately, no 
  292.          general guidelines  can be given about how  to  do  that 
  293.          because drives differ in their design.
  294.  
  295.          FLOPINFO
  296.          ~~~~~~~~
  297.          This  program simply reads the existing format of a disk 
  298.          and  displays  it.   With all of the  different  formats 
  299.          supported  by FDFORMAT and ATFMT it's nice to know  what 
  300.          format a particular disk is.   Also, since some of these 
  301.          formats require a TSR to read, you might want to know if 
  302.          a  particular floppy can be read on another system which 
  303.          doesn't have a copy of that TSR available.  Or,  perhaps 
  304.          you  want  to quickly find out whether a floppy is HD or 
  305.          DD.
  306.          
  307.          FLOPINFO takes one parameter, the drive letter.  Here is 
  308.          an example command  and response,  again  for a 720K 3½" 
  309.          disk 
  310.  
  311.     flopinfo b
  312.  
  313.     Floppy Disk Information, Ver. 1.0 by luitje@m-net.arbornet.org
  314.     OEM Name: IBM  3.3, 512 Bytes/Sector, 9 Sectors/Track, 80 Tracks, 2 Sides
  315.     2 FATs, 1 Reserved Sectors, 112 Directory Entries
  316.     Total Capacity is 730112
  317.  
  318.          Registration
  319.          ~~~~~~~~~~~~
  320.          While this software may be freely copied and used,  I do 
  321.          request  that you register it if you use it.   Just send 
  322.          me  either  a postcard or some e-mail telling me who you 
  323.          are and where you are and what you like or dislike about 
  324.          the  program.  This is only partially an ego massage for 
  325.          the author.   I  enjoy writing useful utilities and have 
  326.          several other pieces of freeware out floating around the 
  327.          net  so  I  would  like feedback about which of them  is 
  328.          worth expanding and supporting. 
  329.  
  330.          This software is intended to be safe to use.   All tests 
  331.          and information programs are read only.   About the only 
  332.          problem  you  might have is that if you set  the  floppy 
  333.          drive  parameters  too fast you may get  read  or  write 
  334.          errors.    Never  the less,  in using this software  you 
  335.          assume all risk should anything go wrong.  I  think that 
  336.          is pretty unlikely, but, hey, sometimes it rains fish! 
  337.  
  338.          William Luitje
  339.          2677 Wayside Drive
  340.          Ann Arbor, MI 48103
  341.          USA
  342.  
  343.          Internet:  luitje@m-net.arbornet.org or 
  344.                     luitje@m-net.ann-arbor.mi.us
  345.  
  346.